<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<title>cms后台模板</title>
<link rel="stylesheet" href="${pageContext.request.contextPath }/frame/layui/css/layui.css">
<link rel="stylesheet" href="${pageContext.request.contextPath }/frame/static/css/admin.css" />

</head>
<body>
	<!-- 布局容器 -->
	<div class="layui-layout layui-layout-admin">
		<!-- 头部 -->
		<div class="layui-header">
			<div class="layui-main">
				<div class="top-left">
					<!-- logo -->
					<a href="/" class="logo">江岸日用化工管理</a> <a href="javascript:;"
						class="menu-flexible"> <i class="layui-icon">&#xe635;</i>
					</a>
				</div>
				<!-- 头部一级菜单 -->
				<ul class="layui-nav top-menu" lay-filter="top-menu">
					 <li class = "layui-nav-item"><a href="javascript:;">工作台</a></li>
                <li class = "layui-nav-item"><a href="javascript:;">模型管理</a></li>
                <li class = "layui-nav-item"><a href="javascript:;">模块设计</a></li>
                <li class = "layui-nav-item"><a href="javascript:;">常用工具</a></li>
                <li class = "layui-nav-item"><a href="javascript:;">文件管理</a></li>
                <li class="layui-nav-item">
                    <a href="javascript:;">系统设置<span class="layui-nav-more"></span></a>
                    <dl class="layui-nav-child">
                        <dd><a href="">邮件管理</a></dd>
                        <dd><a href="">消息管理</a></dd>
                        <dd><a href="">授权管理</a></dd>
                    </dl>
                </li>
				</ul>
				<!-- 头部右侧操作 -->
				<ul class="layui-nav operate">
					<li class="layui-nav-item"><a href="javascript:;">进入前台</a></li>
					<li class="layui-nav-item"><a href="javascript:;">${userInfo.username}</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;">个人信息</a>
							</dd>
							<dd>
								<a id="editpwd" href="#">修改密码</a>
							</dd>
							<dd>
								<a href="javascript:;">退出登录</a>
							</dd>
						</dl></li>
				</ul>
			</div>
		</div>

		<!-- 左侧菜单 -->
		<div class="layui-side layui-bg-black left-menu-all">
			<div class="layui-side-scroll">
				<ul class="layui-nav layui-nav-tree left-menu"
					lay-filter="left-menu">
					<li class="layui-nav-item layui-this"><a href="javascript:;"
						data-url="page_common_home.action" data-id="1">首页</a></li>
					<li class="layui-nav-item"><a href="javascript:;">部门管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" data-url="page_dept_dept.action" data-id="2">部门列表</a>
							</dd>
							<dd>
								<a href="javascript:;" data-url="page_dept_restoreDept.action" data-id="3">恢复部门</a>
							</dd>
						</dl></li>
						<li class="layui-nav-item"><a href="javascript:;">员工管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" data-url="page_emp_emp.action" data-id="4">员工列表</a>
							</dd>
							<dd>
								<a href="javascript:;" data-url="page_emp_restoreEmp.action" data-id="5">恢复员工</a>
							</dd>
							<dd>
								<a href="javascript:;" data-url="page_emp_queryEmp.action" data-id="6">查询员工</a>
							</dd>
						</dl></li>
						<li class="layui-nav-item"><a href="javascript:;">产品管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" data-url="#" data-id="12">产品类别</a>
							</dd>
							<dd>
								<a href="javascript:;" data-url="#" data-id="13">产品列表</a>
							</dd>
						</dl></li>
						<li class="layui-nav-item"><a href="javascript:;">库存管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" data-url="#" data-id="14">所有库存列表</a>
							</dd>
							<dd>
								<a href="javascript:;" data-url="#" data-id="15">查看库存</a>
							</dd>
						</dl></li>
						
				</ul>
				<ul class="layui-nav layui-nav-tree left-menu"
					lay-filter="left-menu">
					<li class="layui-nav-item"><a href="javascript:;">模块管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" data-url="https://www.layui.com/doc/"
									data-id="7">操作日志</a>
							</dd>
						</dl></li>
				</ul>
				<ul class="layui-nav layui-nav-tree left-menu"
					lay-filter="left-menu">
					<li class="layui-nav-item"><a href="javascript:;">导航管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" data-url="https://www.layui.com/doc/"
									data-id="8">导航列表</a>
							</dd>
						</dl></li>
				</ul>
				<ul class="layui-nav layui-nav-tree left-menu"
					lay-filter="left-menu">
					<li class="layui-nav-item"><a href="javascript:;">常用工具</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" data-url="https://www.baidu.com"
									data-id="9">qq</a>
							</dd>
							<dd>
								<a href="javascript:;" data-url="https://www.baidu.com"
									data-id="10">微信</a>
							</dd>
						</dl></li>
				</ul>
				<ul class="layui-nav layui-nav-tree left-menu"
					lay-filter="left-menu">
					<li class="layui-nav-item"><a href="javascript:;">会员管理</a>
						<dl class="layui-nav-child">
							<dd>
								<a href="javascript:;" data-url="https://www.layui.com/doc/"
									data-id="11">会员列表</a>
							</dd>
						</dl></li>
				</ul>
			</div>
		</div>

		<!-- 主体 -->
		<div class="layui-body">
			<!-- 顶部切换卡 -->
			<div class="layui-tab layui-tab-card" lay-filter="top-tab"
				lay-allowClose="true">
				<ul class="layui-tab-title"></ul>
				<div class="layui-tab-button">
					<a href="javascript:;"><i class="layui-icon">&#x1002;</i></a>
				</div>
				<div class="layui-tab-content"></div>
			</div>
		</div>

		<!-- 底部 -->
		<div class="layui-footer">江岸日用化工</div>
		
		<div id="edit_pwd_div" hidden="hidden">
		<form id = "editpwdForm" class="layui-form" method="post" lay-filter="editpwd_filter">
			<div class="layui-form-item">
				<label class="layui-form-label">新密码：</label>

				<div class="layui-input-inline">
					<input type="password" name="password1" class="layui-input"
						lay-verify="required" lay-verify="password" placeholder="密码" maxlength="20" />
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">确定密码：</label>

				<div class="layui-input-inline">
					<input type="password" name="password2" class="layui-input"
						lay-verify="required" lay-verify="password" placeholder="密码" maxlength="20" />
				</div>
			</div>
				<div class="layui-form-item">
					<div class="layui-input-block">
						<button id ="edit_pwd_btn" class="layui-btn" lay-filter="edit" type="submit" lay-submit="">确定</button>
						<button id ="no_pwd_btn" class="layui-btn">取消</button>
					</div>
				</div>
		</form>
	</div>
</div>
	
<script type="text/javascript" src="${pageContext.request.contextPath}/frame/layui/layui.js"></script>
<script type="text/javascript" src="${pageContext.request.contextPath}/frame/static/js/admin.js"></script>
<script type="text/javascript">
	layui.use([ 'form', 'layer','jquery' ], function() {
		// 操作对象
		var form = layui.form, 
			layer = layui.layer, 
			$ = layui.jquery;

		var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
		//修改密码弹出框
		//var edit = $("#edit_pwd_div").html();
		//修改按钮
		$("#editpwd").click(function() {
			layer.open({
				type : 1,
				title : '修改密码',
				area : [ '400px', '250px' ],
				content : $("#edit_pwd_div")//这里content是一个普通的String
			});
		});
		$("#no_pwd_btn").click(function() {
			 layer.close(index);
		});
		//表单提交事件
        form.on('submit(editpwd_filter)', function (data) {
        	//表单输入的密码
            var pwd1 = $("#password1").val();
            layer.alert(pwd1);
            var pwd2 = $("#password2").val();
            if (pwd1 == pwd2) {
            	$.post("${pageContext.request.contextPath}/userAction_editPwd.action",
            		{password:password1},
                      function (data,result) {
	            		if(result =='ok'){
	            			//location.href = '${pageContext.request.contextPath}/login.jsp';
	                        layer.close(index);
	            		}
                      });
	            }else{
	            	layer.alert("两次输入密码不一致！");
	            }
	            return false; //阻止表单跳转。如果需要表单跳转，去掉这段即可。
        });
      
	 });
</script>
</body>
</html>